home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM Gold
/
Light ROM Gold.iso
/
arexx
/
modeler
/
absolute.lwm
next >
Wrap
Text File
|
1995-03-23
|
1KB
|
51 lines
/* CMD: Absolute Position
* Place an Object using absolute coordinates of its center
* By Nir Hermoni, Israel
* zapa@datasrv.co.il
*/
libadd = addlib("LWModelerARexx.port",0)
signal on error
signal on syntax
box=boundingbox() /* Should check out empty list ... */
parse var box n x1 x2 y1 y2 z1 z2
cx=(x2+x1)/2
cy=(y2+y1)/2
cz=(z2+z1)/2
call req_begin("Absolute Position")
XID = req_addcontrol("X Position","N",1)
YID = req_addcontrol("Y position","N",1)
ZID = req_addcontrol("Z position","N",1)
call req_setval XID,cx
call req_setval YID,cy
call req_setval ZID,cz
if (~req_post()) then do
call req_end
exit
end
xpos = req_getval(XID)
ypos = req_getval(YID)
zpos = req_getval(ZID)
call req_end()
deltax = -(cx-xpos)
deltay = -(cy-ypos)
deltaz = -(cz-zpos)
call MOVE(deltax deltay deltaz)
if (libadd) then call remlib("LWModelerARexx.port")
exit
syntax:
error:
t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
if (libadd) then call remlib("LWModelerARexx.port")
exit